import { AppDataComplete } from '../../imex/sync/sync.model';

export type AllowedDBKeys = keyof AppDataComplete | 'SUP_COMPLETE_BACKUP';

// INDEXEDDB
export enum DB {
  BACKUP = 'SUP_COMPLETE_BACKUP',
  LOCAL_NON_SYNC = 'LOCAL_NON_SYNC',
  // and lot's of non hard-coded AppDataComplete keys
}

// REAL LS
export enum LS {
  LAST_LOCAL_SYNC_MODEL_CHANGE = 'SUP_LAST_LOCAL_SYNC_MODEL_CHANGE',
  LOCAL_UI_HELPER = 'SUP_UI_HELPER',
  LAST_REMINDER_DATE = 'SUP_LAST_REMINDER_DATE',

  SYNC_LOCAL_LAST_SYNC_PREFIX = 'SUP_SYNC_LOCAL_LAST_SYNC_',
  SYNC_LAST_LOCAL_REVISION_PREFIX = 'SUP_SYNC_LAST_REVISION_',

  GOOGLE_SESSION = 'SUP_GOOGLE_SESSION',

  ACTION_LOG = 'SUP_ACTION_LOG',
  ACTION_BEFORE_LAST_ERROR_LOG = 'SUP_LAST_ERROR_ACTION_LOG',
  CHECK_STRAY_PERSISTENCE_BACKUP = 'SUP_CHECK_STRAY_PERSISTENCE_BACKUP',
  IS_PROJECT_LIST_EXPANDED = 'SUP_IS_PROJECT_LIST_EXPANDED',
  IS_TAG_LIST_EXPANDED = 'SUP_IS_TAG_LIST_EXPANDED',

  WAS_TIMELINE_INITIAL_DIALOG_SHOWN = 'SUP_WAS_TIMELINE_INITIAL_DIALOG_SHOWN',

  TIMELINE_CACHE = 'SUP_TIMELINE_CACHE',
  CALENDER_EVENTS_SKIPPED_TODAY = 'SUP_CALENDER_EVENTS_SKIPPED_TODAY',
  CALENDER_EVENTS_LAST_SKIP_DAY = 'SUP_CALENDER_EVENTS_LAST_SKIP_DAY',

  LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_ADD = 'SUP_LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_ADD',

  LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_ADD_TODAY = 'SUP_LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_ADD_TODAY',
  LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_EDIT = 'SUP_LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_EDIT',
  LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_EDIT_TODAY = 'SUP_LAST_IS_MOVE_SCHEDULED_TO_BACKLOG_EDIT_TODAY',

  IS_SHOW_TOUR = 'SUP_IS_SHOW_TOUR',

  LAST_FULLSCREEN_EDIT_VIEW_MODE = 'SUP_LAST_FULLSCREEN_EDIT_VIEW_MODE',

  WEB_APP_INSTALL = 'WEB_APP_INSTALL',
}

// SESSION STORAGE
export enum SS {
  NOTE_TMP = 'NOTE_TMP_EDIT',
  PROJECT_TMP = 'PROJECT_TMP_EDIT',
  JIRA_WONKY_COOKIE = 'JIRA_WONKY_COOKIE',
  TODO_TMP = 'TODO_TMP_EDIT',
}

// LEGACY KEYS
export const DB_LEGACY_PROJECT_PREFIX = 'SUP_P_';

export enum DB_LEGACY {
  GLOBAL_CFG = 'SUP_GLOBAL_CFG',
  REMINDER = 'SUP_REMINDER',
  PROJECT_ARCHIVE = 'SUP_ARCHIVE',

  TASK_ARCHIVE = 'TASKS_ARCHIVE',
  TASK_STATE = 'TASKS_STATE',
  TASK_REPEAT_CFG_STATE = 'TASK_REPEAT_CFG_STATE',

  // saved in tasks
  // TASK_ATTACHMENT_STATE = 'TASK_ATTACHMENT_STATE',

  PROJECT_META_LIST = 'SUP_PROJECT_META_LIST',

  TAG_STATE = 'TAG_STATE',
  SIMPLE_COUNTER_STATE = 'SIMPLE_COUNTER_STATE',

  // Project model
  BOOKMARK_STATE = 'BOOKMARK_STATE',

  // Former project models
  NOTE_STATE = 'NOTE_STATE',
  METRIC_STATE = 'METRIC_STATE',
  IMPROVEMENT_STATE = 'IMPROVEMENT_STATE',
  OBSTRUCTION_STATE = 'OBSTRUCTION_STATE',
}
